Kafka Quick Guide

1. Open "Command Prompt"
2. Move to the folder where the "docker-compose.yml" file is located 
3. Run the following command: docker-compose up -d

4. Check if the system is working properly: 
4.1 Download the following graphical tool: https://kafkatool.com/features.html
4.2 Create a new connection by providing a cluster name, the zookeper port and 
at least one bootstrap server (see "Advanced tab")
4.3 Click on "Test connection"

5. Open the shell on the Kafka container and issue the following command to create a new topic:
kafka-topics --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 3 --topic mytopic

6. Start a CLI Kafka Producer and send data to your topic
kafka-console-producer --broker-list localhost:9092 --topic mytopic

7. Start a CLI Kafka consumer
kafka-console-consumer --bootstrap-server localhost:9092 --topic mytopic --from-beginning

8. Publish data in the form key:value
kafka-console-producer --broker-list localhost:9092 --topic mytopic2 --property parse.key=true --property key.separator=:

Source: https://www.baeldung.com/ops/kafka-docker-setup